//
//  YXReplyHeaderView.m
//  CreditCard
//
//  Created by 杨旭 on 2018/1/30.
//  Copyright © 2018年 杨旭. All rights reserved.
//

#import "YXReplyHeaderView.h"
#import "YXReplyModel.h"
@interface  YXReplyHeaderView ()
@property (weak, nonatomic) IBOutlet UIImageView *picImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (weak, nonatomic) IBOutlet UILabel *timeLab;
@property (weak, nonatomic) IBOutlet UILabel *contentLab;
@property (weak, nonatomic) IBOutlet UIView *lineView;

@end
@implementation YXReplyHeaderView

-(instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        // 从xib中找到我们定义的view
        NSArray *viewArray = [[NSBundle mainBundle]loadNibNamed:@"YXReplyHeaderView" owner:self options:nil];
        self = viewArray[0];
        self.frame = frame;
        
        self.contentLab.userInteractionEnabled = YES;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
        [self.contentLab addGestureRecognizer:tap];
        
    }
    return self;
    
}

- (void)setModel:(YXReplyModel *)model {
    _model = model;
    
    [_picImageView sd_setImageWithURL:[NSURL URLWithString:_model.repliesAgentImg] placeholderImage:[UIImage imageNamed:@""]];
    _nameLab.text = _model.replyAgentName;
    _timeLab.text = [UILabel formateData:_model.createDate];
    _contentLab.text = [NSString stringWithFormat:@"    %@",_model.contents];
    
    _lineView.hidden = YES;
}

#pragma mark - click
- (void)tapAction {
    
//    self.clickContent(self.model);
}


@end
